import time
import uuid
import hashlib

# 填写你的参数
DomainName = "www.lhlhal.com"
Filename = "login"
pushAKey = "abcdefg"

# 生成随机数和时间戳
# 获取当前时间戳（UTC+8，格式为YYYYMMDDHHMM）。
rand = uuid.uuid4().hex
timestamp = time.strftime('%Y%m%d%H%M', time.localtime(time.time() + 8 * 3600))
print(timestamp)

# 拼接字符串计算MD5
sstring = f"{pushAKey}{timestamp}/{Filename}"
print(sstring)
md5hash = hashlib.md5(sstring.encode()).hexdigest()
print(md5hash)
# 构建鉴权URL
Url = f"http://{DomainName}/{timestamp}/{md5hash}/{Filename}"

print(Url)